package com.itheima.app.controller;

import com.itheima.app.manager.CardManager;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CardController {

    @Autowired
    private CardManager cardManager;

    /**
     * 卡片展示
     * @return
     */
    @GetMapping("/tanhua/cards")
    public ResponseEntity cards() {

        return cardManager.cards();
    }

    /**
     * 卡片_左划不喜欢
     */
    @GetMapping("/tanhua/{noLikeId}/unlove")
    public void noLikeCard(@PathVariable Integer noLikeId) {
        cardManager.noLikeCard(noLikeId);
    }

    /**
     * 卡片_右划喜欢
     */
    @GetMapping("/tanhua/{likeId}/love")
    public void likeCard(@PathVariable Integer likeId) {
        cardManager.likeCard(likeId);
    }
}